package demo1;

interface CanFly {
    public void fly();
}

class Plane implements CanFly {

    @Override
    public void fly() {
        System.out.println("plane can fly");
    }
}

class Bird implements CanFly {
    @Override
    public void fly() {
        System.out.println("bird can fly");
    }
}

public class test {
    void makeFly(CanFly cf) {
        cf.fly();
    }
    public static void main(String[] args) {
        test t = new test();
        t.makeFly(new Plane());
        t.makeFly(new Bird());
    }
}
